﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;

namespace RapChieuPhim
{
    public partial class QuanLyRapPhim : Form
    {
        public QuanLyRapPhim()
        {
            InitializeComponent();
        }

        private void btnDatVe_Click(object sender, EventArgs e)
        {
            DatVe frmDatVe = new DatVe();
            frmDatVe.ShowDialog();
        }

        private void btnPhim_Click(object sender, EventArgs e)
        {
            PhimChieu frm = new PhimChieu();
            frm.Show();
        }



        #region Xy Ly Nhan Vien
        private void btnLoadData_Click(object sender, EventArgs e)
        {
            dtgdsNhanVien.DataSource = NhanVienBUS.LoadDSNhanVien();
            binding();
        }

        private void binding()
        {
            cbxMaNV.DataBindings.Clear();
            cbxMaNV.DataBindings.Add("Text",dtgdsNhanVien.DataSource,"MaNV");

            txtHoTenNV.DataBindings.Clear();
            txtHoTenNV.DataBindings.Add("Text", dtgdsNhanVien.DataSource, "HoTen");
            
            dtpNgaySinh.DataBindings.Clear();
            dtpNgaySinh.DataBindings.Add("Text", dtgdsNhanVien.DataSource, "NgaySinh");

            txtCMND.DataBindings.Clear();
            txtCMND.DataBindings.Add("Text", dtgdsNhanVien.DataSource, "CMND");
           
            cbxGioiTinh.DataBindings.Clear();
            cbxGioiTinh.DataBindings.Add("Text", dtgdsNhanVien.DataSource, "GioiTinh");

            txtDiaChi.DataBindings.Clear();
            txtDiaChi.DataBindings.Add("Text", dtgdsNhanVien.DataSource, "DiaChi");
            
            txtMaChucVu.DataBindings.Clear();
            txtMaChucVu.DataBindings.Add("Text", dtgdsNhanVien.DataSource, "MaChucVu");
            
            txtMaTinhTrang.DataBindings.Clear();
            txtMaTinhTrang.DataBindings.Add("Text", dtgdsNhanVien.DataSource, "MaTinhTrang");
        }

     
        #endregion

       
    }
}
